package javaer.starter.base.domain.dto;

import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;
import java.util.Objects;

/**
 * 模板
 *
 * @author yangzhen
 * @date 2023/6/5 10:56
 * @since 1.0.0
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class TemplateDTO implements Serializable {
    /**
     * 脚手架类型唯一标识
     */
    String typeId;
    /**
     * 模块唯一标识
     */
    String moduleId;
    /**
     * 依赖唯一标识
     */
    String depId;
    /**
     * 源目录
     */
    String sourceDirectory;
    /**
     * 相对路径
     */
    String relativePath;
    /**
     * 模板名称
     */
    String templateName;
    /**
     * 内容
     */
    String content;

    String resolveName;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TemplateDTO that = (TemplateDTO) o;
        return Objects.equals(typeId, that.typeId) && Objects.equals(moduleId, that.moduleId) && Objects.equals(sourceDirectory, that.sourceDirectory) && Objects.equals(relativePath, that.relativePath) && Objects.equals(templateName, that.templateName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(typeId, moduleId, sourceDirectory, relativePath, templateName);
    }
}